import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Main from '@/components/Main'
import View from '@/components/View'
import Index from '@/components/Index'
import AppLayout from '@/components/app/Layout'
import AppIndex from '@/components/app/Index'
import AppBannerIndex from '@/components/app/banner/Index'
import AppBannerEdit from '@/components/app/banner/Edit'
import AppArticleIndex from '@/components/app/article/ArticleIndex'
import AppCommentIndex from '@/components/app/article/CommentIndex'
import AppArticleEdit from '@/components/app/article/ArticleEdit'
import AppMenuIndex from '@/components/app/article/MenuIndex'
import AppMenuEdit from '@/components/app/article/MenuEdit'
import AppClassEdit from '@/components/app/tag/ClassEdit'
import AppClassIndex from '@/components/app/tag/ClassIndex'
import AppTagIndex from '@/components/app/tag/TagIndex'
import AppTagEdit from '@/components/app/tag/TagEdit'
import AppBrandEdit from '@/components/app/brand/Edit'
import AppBrandIndex from '@/components/app/brand/Index'

Vue.use(Router);


export default new Router({
  mode:'history',
  routes: [
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/',
      name: 'main',
      component: Main,
      redirect:'/index',
      children:[
        {path:'index',name:'index', component:Index},
        {path:'app/:appid',name:'app',component:AppLayout,children:[
          {path:'index',name:'appIndex',component:AppIndex},
          {path:'bannerIndex',name:'appBannerIndex',component:AppBannerIndex,meta:{title:'全部海报'}},
          {path:'bannerEdit',name:'appBannerEdit',component:AppBannerEdit,meta:{title:'新增海报'}},
          {path:'articleIndex',name:'appArticleIndex',component:AppArticleIndex,meta:{title:'全部文章'}},
          {path:'commentIndex',name:'AppCommentIndex',component:AppCommentIndex,meta:{title:'全部评论'}},
          {path:'articleEdit',name:'appArticleEdit',component:AppArticleEdit,meta:{title:'新增文章'}},
          {path:'menuIndex',name:'appMenuIndex',component:AppMenuIndex,meta:{title:'文章栏目'}},
          {path:'menuEdit',name:'appMenuEdit',component:AppMenuEdit,meta:{title:'新增栏目'}},
          {path:'classIndex',name:'appClassIndex',component:AppClassIndex,meta:{title:'标签分类'}},
          {path:'classEdit',name:'classEdit',component:AppClassEdit,meta:{title:'新增分类'}},
          {path:'tagIndex',name:'AppTagIndex',component:AppTagIndex,meta:{title:'所有标签'}},
          {path:'tagEdit',name:'AppTagEdit',component:AppTagEdit,meta:{title:'新增标签'}},
          {path:'brandIndex',name:'AppBrandIndex',component:AppBrandIndex,meta:{title:'所有品牌'}},
          {path:'brandEdit',name:'AppBrandEdit',component:AppBrandEdit,meta:{title:'新增品牌'}},
        ]}
      ]
    }
  ]
})
